﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Scripting;
using CoolEngine.Engine.Scripting;
using Microsoft.Scripting.Runtime;

namespace CoolEngine.Engine
{
    public static class CommandParser
    {
        public static void RunCommand(string commandLine)
        {
            commandLine = commandLine.Replace("\\n", "\n");
            try
            {
                HardCodedCommandParser.RunCommand(commandLine);
            }
            catch (CommandNotFoundException)
            {
                ScriptManager.RunCommand(commandLine);
            }
        }
    }
}
